package com.rytx.system.mapper;

import java.util.List;
import com.rytx.system.domain.ShippingAddresses;
import org.apache.ibatis.annotations.Param;

/**
 * 收货地址Mapper接口
 *
 * @author rytx
 * @date 2024-07-01
 */
public interface ShippingAddressesMapper
{
    /**
     * 查询收货地址
     *
     * @param id 收货地址主键
     * @return 收货地址
     */
    public ShippingAddresses selectShippingAddressesById(Long id);
    public ShippingAddresses selectShippingAddressesByIdAndUserId(ShippingAddresses shippingAddresses);

    /**
     * 查询收货地址列表
     *
     * @param shippingAddresses 收货地址
     * @return 收货地址集合
     */
    public List<ShippingAddresses> selectShippingAddressesList(ShippingAddresses shippingAddresses);

    /**
     * 新增收货地址
     *
     * @param shippingAddresses 收货地址
     * @return 结果
     */
    public int insertShippingAddresses(ShippingAddresses shippingAddresses);

    /**
     * 修改收货地址
     *
     * @param shippingAddresses 收货地址
     * @return 结果
     */
    public int updateShippingAddresses(ShippingAddresses shippingAddresses);
    public int updateShippingAddressesByUserId(ShippingAddresses shippingAddresses);

    /**
     * 删除收货地址
     *
     * @param id 收货地址主键
     * @return 结果
     */
    public int deleteShippingAddressesById(Long id);

    /**
     * 批量删除收货地址
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteShippingAddressesByIds(Long[] ids);
    /**
     * 清除当前用户所欲收货地址默认状态
     */
    public void cleardefaultaddress(Long userId);
    /**
     * 修改收货地址默认状态
     */
    public void updatedefaultaddress(@Param("userId")Long userId, @Param("id")Long id);
    /**
     * 修改收货地址默认状态
     */
    public ShippingAddresses getdefaultaddress(Long userId);
}
